<?php

class Application_Form_Banner extends Zend_Form
{
    public function init()
    {
        $this->setName('Banner');

        $banner_id = new Zend_Form_Element_Hidden('banner_id');
        $banner_id->addFilter('Int');

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Tên:')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');
              
        $text = new Zend_Form_Element_Text('text');
        $text->setLabel('Text:')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
               
    
               
        $start_date = new Zend_Form_Element_Text('start_date');
        $start_date->setLabel('Ngày bắt đầu:')
        		->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
        					  
       $expired_date = new Zend_Form_Element_Text('expired_date');
       $expired_date->setLabel('Ngày hết hạn:')
        		->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
        					  
        $client_id = new Zend_Form_Element_Select('client_id');
        $client_id->setLabel('Khách hàng:')
        //        ->setRequired(true)
                ->addMultiOptions(array(
                 	'1' => 'cong ty xxx',
                	'2' => 'cong ty ma',
        ));
        					  
        $code = new Zend_Form_Element_Text('code');
        $code->setLabel('Mã:')
        	//	->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
        					  
        $click_url = new Zend_Form_Element_Text('click_url');
        $click_url->setLabel('Click url:')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
               
      
               
        $format = new Zend_Form_Element_Select('format');
        $format->setLabel('Định dạng:')
        
                ->addMultiOptions(array(
                 	'1' => 'Hình ảnh',
                	'2' => 'Flash',
                	'3' => 'Văn bản',
                	'4' => 'HTML',
        ));
        					  
       	$image_url = new Zend_Form_Element_Text('image_url');
        $image_url->setLabel('Image url:')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
       
       
               				  
        $status = new Zend_Form_Element_Select('status');
        $status->setLabel('Trạng thái:')
        
                ->addMultiOptions(array(
                 	'1' => 'Đã kích hoạt',
                	'2' => 'Chưa kích hoạt',
        ));
               
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'AddButton');

        $cancel = new Zend_Form_Element_Submit('cancel');
        $cancel->setAttrib('id', 'CancelButton');

        $this->addElements(array($banner_id, $name,$text,$start_date,$expired_date,$client_id,$code,$click_url,$format,$image_url,$status,$submit,$cancel));
    }
}